define(["../../app",
    "jquery"
], function(app) {
	
	var deps = ["$scope","$modalInstance","picId"];
	
	function controller($scope,$modalInstance,picId) {

        $scope.close= function(){
            $modalInstance.close();
        };

        $scope.picId = picId;
        
        var img = new Image();
        img.src = "restful/fileUploadController/showPic/" + picId;
        img.onload = function(){
            var $dialog = $(".imgView-dialog-window");
            $dialog.find(".modal-dialog").css("width",img.width + "px");
        };
    }
	
	controller.$inject = deps;
	app.lazy.controller("ImgViewController", controller);
});
